package zhaoq_hero.mymv.utils;

import android.content.Intent;
import android.net.Uri;
import android.provider.MediaStore;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;

import java.io.File;

import zhaoq_hero.mymv.R;

public class SecondActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_second);

    }

    public void btnRecorder(View view) {

        //使用  意图     打开手机的录像  开始录像。。。
        Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);

        File file = FileUtils.getMediaRecorderFolder(getApplicationContext());
        File targetFile = new File(file, "audio-" + System.currentTimeMillis() + ".mp4");


        Uri uri = Uri.fromFile(targetFile);

        intent.putExtra(MediaStore.EXTRA_OUTPUT, uri);

        startActivityForResult(intent, 999);

    }


}
